package com.copa.module.user.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.copa.domain.PageVo;
import com.copa.domain.ResponseDto;
import com.copa.module.user.domain.dto.AddressDto;
import com.copa.module.user.domain.entity.UserAddressEntity;
import com.copa.module.user.domain.entity.UserEntity;
import com.copa.module.user.service.UserAddressService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author copa
 * @createDate 2021-01-09 14:01
 * @function
 */
@RestController
@Api(tags = {"用户地址操作接口"})
public class UserAddressController {

    @Autowired
    private UserAddressService userAddressService;

    @PostMapping("/address/list")
    @ApiOperation(value = "查询该用户的所有地址")
    public ResponseDto<List<AddressDto>> list(@RequestBody Long userId) {
        return userAddressService.list(userId);
    }
}
